package com.shiwaixiangcun.customer.ui.activity

import android.os.Build
import android.os.Bundle
import android.util.Log
import android.webkit.WebView
import com.xujhin.hybridsdk.core.HybridAjaxService
import com.xujhin.hybridsdk.ui.HybridWebViewActivity

class HybirdTestActivity : HybridWebViewActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Log.e("vane", "DemoMainActivity onCreate")
        //        HybridAjaxService.checkVersion(context);
        HybridAjaxService.checkVersion(this)
    }


    override fun getUrl(): String? {
        val data = intent.data
        var url: String? = null
        if (null == data) {
            url = intent.getStringExtra("url")
        } else {
            url = data.toString()
        }
        return url
    }


    override fun onDestroy() {
        super.onDestroy()
        Log.e("vane", "DemoMainActivity onDestroy")
    }

    override fun initConfig(webView: WebView) {
        super.initConfig(webView)
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
            //方便webview在choreme调试
            WebView.setWebContentsDebuggingEnabled(true)
        }
    }
}
